<!DOCTYPE html>
<html lang="en"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">
    <title>XX应用平台</title>
    <link th:href="@{/webjars/bootstrap/5.1.3/css/bootstrap.min.css}" rel="stylesheet" type="text/css">
    <link th:href="@{/css/style.min.css}" rel="stylesheet" type="text/css">
</head>
<body class="gray-bg top-navigation">
    <div class="gray-bg">
        <div class="wrapper wrapper-content">
            <div class="container">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-title">
                                <!-- 获取当前登陆人账号 -->
                                <h5>权限演示 [当前登陆账号:<shiro:principal property="name"/>]</h5>
                            </div>
                            <!-- 判断用户是否登陆 -->
                            <div class="ibox-tools">
                                <!-- 点击退出 -->
                                <form th:action="@{/auth/logout}" method="post">
                                    <button type="submit" class="btn btn-danger">退出</button>
                                </form>
                            </div>
                            <div class="ibox-content">
                                <div class="tabs-left">
                                    <ul class="nav nav-tabs">
                                        <li class="nav-item">
                                            <a class="nav-link active" data-bs-toggle="tab" href="#tab-1">角色</a>
                                        </li>
                                        <li class="nav-item">
                                            <a class="nav-link" data-bs-toggle="tab" href="#tab-2">权限</a>
                                        </li>
                                    </ul>
                                    <div class="tab-content">
                                        <div id="tab-1" class="tab-pane active">
                                            <div class="panel-body">
                                                <div class="file-manager">
                                                    <ul class="tag-list" shiro:hasRole="ADMIN">
                                                        <button type="button" class="btn btn-outline btn-primary">ADMIN</button>
                                                    </ul>
                                                    <ul class="tag-list" shiro:hasRole="USERS">
                                                        <button type="button" class="btn btn-outline btn-primary">USERS</button>
                                                    </ul>
                                                    <div class="clearfix"></div>
                                                </div>
                                            </div>
                                        </div>
                                        <div id="tab-2" class="tab-pane">
                                            <div class="panel-body">
                                                <div class="file-manager">
                                                    <ul class="tag-list">
                                                        <!-- 输出当前登陆用户权限列表 -->
                                                        <button type="button" class="btn btn-outline btn-info" shiro:hasPermission="'user:insert'">添加</button>
                                                        <button type="button" class="btn btn-outline btn-info" shiro:hasPermission="'user:update'">修改</button>
                                                        <button type="button" class="btn btn-outline btn-info" shiro:hasPermission="'user:delete'">删除</button>
                                                        <button type="button" class="btn btn-outline btn-info" shiro:hasPermission="'user:select'">查询</button>
                                                    </ul>
                                                    <div class="clearfix"></div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <h3>以下页面是鉴权页面</h3>
                        <div class="ibox float-e-margins">
                            <iframe th:src="@{/user/insert}" style="width:100%;height: 500px;"></iframe>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script th:src="@{/webjars/jquery/3.6.0/jquery.min.js}" type="text/javascript"></script>
    <script th:src="@{/webjars/bootstrap/5.1.3/js/bootstrap.min.js}" type="text/javascript"></script>
    <script>
        $(document).ready(function(){
            $(document).ready(function(){
                function animationHover(o,e){o=$(o),o.hover(function(){o.addClass("animated "+e)})}
                $(".file-box").each(function(){animationHover(this,"pulse")})
            });
        });
    </script>
</body>
</html>